package com.aacar.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.aacar.dao.DictionaryDao;
import com.aacar.entity.Dictionary;
import com.aacar.service.DictionaryService;
import com.aacar.vo.DictionaryVo;

/**
 * 字典服务
 * @author wangh
 *
 */
@Repository("dictionaryService")
public class DictionaryServiceImpl implements DictionaryService{
	
	@Autowired
	private DictionaryDao dictionaryDao;
	
	//获取单个value
	public String getValueByPreAndKey(String preType, String key) {
		Dictionary dic = new Dictionary();
		dic.setPreType(preType);
		dic.setKey(key);
		return this.dictionaryDao.getValueByPreAndKey(dic);
	}

	//获取集合
	public List<DictionaryVo> getKeyAndValueByType(String preType) {
		return this.dictionaryDao.getKeyAndValueByType(preType);
	}

}
